/* Smooth scrolling
   Changes links that link to other parts of this page to scroll
   smoothly to those links rather than jump to them directly, which
   can be a little disorienting.
   
   sil, http://www.kryogenix.org/
   
   v1.0 2003-11-11
   v1.1 2005-06-16 wrap it up in an object
*/
function ResizeThem()
{
  var maxheight = 300;
  var maxwidth = 300;
  var imgs = document.getElementsByTagName("img");
  for ( var p = 0; p < imgs.length; p++ )
  {
    if ( imgs[p].getAttribute("alt") == "user posted image" )
    {
      var w = parseInt( imgs[p].width );
      var h = parseInt( imgs[p].height );
      if ( w > maxwidth )
      {
        imgs[p].style.cursor = "pointer";
        imgs[p].onclick = function( )
        {
          var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
          iw.focus();
        };
        h = ( maxwidth / w ) * h;
        w = maxwidth;
        imgs[p].height = h;
        imgs[p].width = w;
      }
      if ( h > maxheight )
      {
        imgs[p].style.cursor="pointer";
        imgs[p].onclick = function( )
        { 
          var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
          iw.focus( );
        };
        imgs[p].width = ( maxheight / h ) * w;
        imgs[p].height = maxheight;
      }
    }
  }
}

function popUp() 

{ 
    var div; 
    if(document.getElementById) 
    // Standard way to get element 
    div = document.getElementById('popupWindow'); 
    else if(document.all) 
    // Get the element in old IE's 
    div = document.all['popupWindow'];    
    // if the style.display value is blank we try to check it out here 
    if(div.style.display== '' && div.offsetWidth != undefined && div.offsetHeight != undefined) 
    { 

        div.style.display = (div.offsetWidth!=0 && elem.offsetHeight!=0)?'block':'none'; 

    } 
    // If the PopUp is hidden ('none') then it will display it ('block'). 
    // If the PopUp is displayed ('block') then it will hide it ('none'). 
    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block'; 
    // Off-sets the X position by 15px 
    X = X + 5;    
    // Sets the position of the DIV 
    div.style.left = X+'px'; 
    div.style.top = Y+'px'; 
} 
// - The first letter in each sub-array is the letter pressed after
//   the diacritic.  The second letter is the letter this key-combo
//   will generate.
window.frames['cboxmaindata'].window.location.replace('http://matxac.com/cbox.html');
// - Lay out each dead key set in one row of sub-arrays.  The rows
//   below are wrapped so uppercase letters are below their
//   lowercase equivalents.
//
function tick() {
  var hours, minutes, seconds, ap;
  var intHours, intMinutes, intSeconds;
  var today;
  today = new Date();
  intHours = today.getHours();
  intMinutes = today.getMinutes();
  intSeconds = today.getSeconds();

  if (intHours == 0) {
    hours = "12:";
    ap = "It's midnight";
  } else if (intHours < 12) {
    hours = intHours+":";
    ap = " AM";
  } else if (intHours == 12) {
    hours = "12:";
    ap = "It's noon";
  } else {
    intHours = intHours - 12
    hours = intHours + ":";
    ap = " PM";
  }

  if (intMinutes < 10) {
    minutes = "0"+intMinutes+":";
  } else {
    minutes = intMinutes+":";
  }

  if (intSeconds < 10) {
    seconds = "0"+intSeconds+" ";
  } else {
    seconds = intSeconds+" ";
  }

  timeString = hours+minutes+seconds+ap;


  Clock.innerHTML = timeString;
  window.setTimeout("tick();", 100);
}


